<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 你如何理解this */
        /*
        1、对象--在方法中
        2、在事件
         */
        var a = 10;
        let b = 20
        let fn = () => {
            console.log(this, 'fn')// window
            const c = () => {
                console.log(this, 'c')// Window 
            }
            c()
        }
        fn()
        function show() {
            console.log("show")
            const b = () => {
                console.log(this, 'b')// Window 
            }
            b()
        }
        console.log(this, 'window');
        console.log(this.a)
        console.log(this.b)// undefined
        console.log(this.fn)// undefined
        this.show();

        function fun() {
            console.log(this)
        }
        fun();
        /* 1、在普通的方法中,this指window */
    </script>
</body>

</html>